<?php
/**
* @package   auto_occasion
* @subpackage essais
* @author    your name
* @copyright 2011 your name
* @link      http://www.yourwebsite.undefined
* @license    All rights reserved
*/

class FoEssaiParMarqueCtrl extends jController {
    /**
    * Page essai - par marque - front
    */
    function index() {
        

        jClasses::inc('marqueModele~marqueSrv');
        jClasses::inc('publicite~pubSrv');
        jClasses::inc('commun~parametre');
        jClasses::inc('essais~essaisSrv');
        jClasses::inc('commun~parametre');
        
        $listeMarque = essaisSrv::getAllMarqueInEssai();

        
        $rep = $this->getResponse('htmlFo');        
        $rep->menusActifs = frontHtmlResponse::MENU_ESSAI;
        $rep->breadCrumb  = array(frontHtmlResponse::MENU_ACCUEIL, frontHtmlResponse::MENU_ESSAI) ;

        $rep->addCSSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/css/sliderkit.css');
        
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/carousel_custom.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/jquery.easing.1.3.min.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/jquery.sliderkit.1.9.1.pack.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/essai.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/pub.js');

        jClasses::inc('commun~common');

        //xml pour le header : title, desc, keywords
        $headerContent				= common::readXml(PATH_XML_ESSAIS_LISTE);
        // change le header de la page en cours
        $rep->title					= isset($headerContent->title)?$headerContent->title:'' ;
		$headerContent->keywords	= isset($headerContent->keywords)?$headerContent->keywords :'' ;
		$headerContent->desc		= isset($headerContent->desc)?$headerContent->desc :'' ;
        $keywords					= "<meta name='keywords' content='" . $headerContent->keywords . "'>" ;
        $description				= "<meta name='Description' content='" . $headerContent->desc. "'>" ;
        $rep->addHeadContent($keywords);
        $rep->addHeadContent($description);
        // ---
        
        
        $rep->bodyTpl = 'essais~FoEssaiParMarque';
        $rep->body->assign("listeMarque", $listeMarque);
        
         //pubHidden et rightContent
        $paramPub = array('p1'=>PUB_RIGHT_1_ID,'p2'=>PUB_RIGHT_2_ID,'p3'=>PUB_RIGHT_3_ID,'p4'=>PUB_RIGHT_4_ID,'p5'=>PUB_RIGHT_5_ID,'p6'=>PUB_RIGHT_6_ID);
        $rep->body->assignZone('oZonePubHidden', 'commun~FoPubHidden',$paramPub);
        
        $paramRight = array('ad'=>1,'no_need_cc2'=>1);
        $rep->body->assignZone('oZoneRightContent', 'commun~FoRightContent',$paramRight);
        //---
    
   
        return $rep;
    }
    
    /*
     * Fonction retournant ds essai les modèles 
     * par marque sélectionnée
     */
    function modelesParMarque(){
        jClasses::inc('marqueModele~marqueSrv');
        jClasses::inc('publicite~pubSrv');
        jClasses::inc('commun~parametre');
        jClasses::inc('essais~essaisSrv');
        jClasses::inc('commun~parametre');
        
        $rep = $this->getResponse('htmlFo');        
        $rep->menusActifs = frontHtmlResponse::MENU_ESSAI;
        $rep->breadCrumb  = array(frontHtmlResponse::MENU_ACCUEIL, frontHtmlResponse::MENU_ESSAI) ;

        $idMarque = $this->intParam('idMarque');
        
        $listeModeleParMarque = essaisSrv::getAllModelsByMarqueInEssai($idMarque);

        jClasses::inc('commun~common');

        //xml pour le header : title, desc, keywords
        $headerContent = common::readXml(PATH_XML_ESSAIS_PARMARQUE);
        // change le header de la page en cours
        $rep->title					=	isset($headerContent->title)?$headerContent->title:'' ;
		$headerContent->keywords	=	isset($headerContent->keywords)?$headerContent->keywords:'' ;
		$headerContent->desc		=	isset($headerContent->desc)?$headerContent->desc:'' ;
		$keywords					= "<meta name='keywords' content='" . $headerContent->keywords . "'>" ;
		$description				= "<meta name='Description' content='" . $headerContent->desc. "'>" ;
        $rep->addHeadContent($keywords);
        $rep->addHeadContent($description);
        // ---

        
        
       

         $rep->addCSSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/css/sliderkit.css');
        
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/carousel_custom.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/jquery.idTabs.min.js');
//        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/jquery.galleriffic.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/jquery.easing.1.3.min.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/jquery.sliderkit.1.9.1.pack.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/essai.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/pub.js');
        
        
        $rep->bodyTpl = 'essais~FoEssaisModeleParMarque';
        $rep->body->assign("listeModeleParMarque", $listeModeleParMarque);
        //pubHidden et rightContent
        $paramPub = array('p1'=>PUB_RIGHT_1_ID,'p2'=>PUB_RIGHT_2_ID,'p3'=>PUB_RIGHT_3_ID,'p4'=>PUB_RIGHT_4_ID,'p5'=>PUB_RIGHT_5_ID,'p6'=>PUB_RIGHT_6_ID);
        $rep->body->assignZone('oZonePubHidden', 'commun~FoPubHidden',$paramPub);
        

        $rep->body->assignZone('oZoneRightContent', 'commun~FoRightContent');
        //---
    
   
        return $rep;
    }

}